home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ** $VER: Neon 3.0, IE Arexx script ** Image Engineer Macro script ** Copyright (C) 1997 Simon Edwards ** ** Creates neon light lines out of image's color edges. ** ** Ok, this should be the *definitive* last word in Neon scripts, ** combining best out of my algorithm and Patrik Nydensten's neon ** script. */ Options results Signal on error /* Setup a place for errors to go */ if arg()==0 then exit 'FORM "Neon" "Ok|Cancel"', ' INTEGER,"Size:",1,12,3,SLIDER', ' CHECKBOX,"Highlight Original",0', ' CYCLE,"Method:","Classic Neon|Thick Neon",0', ' INTEGER,"Sharp (Classic only)",1,12,1,SLIDER' parse var result ok thick highlight method sharp thick=thick*2-1 sharp=sharp*2-1 if ok=0 then exit source=arg(1) if method=0 then edgeimage=PatriksNeon() else edgeimage=SimonsNeon() if highlight=1 then do 'MARK' arg(1) 'PRIMARY' 'MARK' edgeimage 'SECONDARY' 'COMPOSITE 0 0 ADD' 'CLOSE' edgeimage end exit PatriksNeon: PROCEDURE EXPOSE source thick sharp 'CONVOLVE' source '"IE:Convolves/ColourLine_Thin"' LineImage = Result if Thick ~= 1 then do 'MAXIMUM' LineImage Thick Thick MaxThickImage = Result 'LOWPASS' MaxThickImage trunc((2+Thick)/2) trunc((2+Thick)/2) ThickImage = Result 'CLOSE' MaxThickImage end else ThickImage = LineImage 'MAXIMUM' LineImage Sharp Sharp SharpImage = Result if Thick ~= 1 then 'CLOSE' LineImage 'MARK' ThickImage 'PRIMARY' 'MARK' SharpImage 'SECONDARY' 'COMPOSITE' 0 0 'ADD' edgeimage = Result 'CLOSE' ThickImage 'CLOSE' SharpImage return edgeimage SimonsNeon: PROCEDURE EXPOSE source thick 'MAXIMUM' source thick thick maximage=Result 'MINIMUM' source thick thick minimage=Result 'MARK' maximage 'PRIMARY' 'MARK' minimage 'SECONDARY' 'COMPOSITE 0 0 DIFFERENCE' edgeimage=Result 'CLOSE' maximage 'CLOSE' minimage return edgeimage /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end